<!DOCTYPE html>
<html lang="en" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/custom.form.css">
</head>
<body>
<div class="jakq_table_div">
    <div id="searchParam">
        <div class="layui-form-item">
            <div class="layui-input-inline layui-form">
                <select id="checkKeShi">
<!--                    <option value="12101009100">请选择检查科室</option>-->
<!--                    <option value="12101009100" th:selected="${swjgDm}==12101009100">全局</option>-->
<!--                    <option value="12101009141" th:selected="${swjgDm}==12101009141">检查一科</option>-->
<!--                    <option value="12101009142" th:selected="${swjgDm}==12101009142">检查二科</option>-->
<!--                    <option value="12101009143" th:selected="${swjgDm}==12101009143">检查三科</option>-->
<!--                    <option value="12101009144" th:selected="${swjgDm}==12101009144">检查四科</option>-->
<!--                    <option value="12101009145" th:selected="${swjgDm}==12101009145">检查五科</option>-->
                </select>
            </div>

            <div class="layui-input-inline layui-form">
                <select id="ajzt">
                    <option value="0">请选择案件状态</option>
                    <option value="0" th:selected="${ajztDm}==0">所有</option>
                    <option value="2" th:selected="${ajztDm}==2">在查</option>
                    <option value="3" th:selected="${ajztDm}==3">在审</option>
                    <option value="4" th:selected="${ajztDm}==4">在执行</option>
                    <option value="901" th:selected="${ajztDm}==901">办结</option>
                    <option value="5" th:selected="${ajztDm}==5">结案</option>
                </select>
            </div>
            <div class="layui-input-inline ">
                <button class="layui-btn" onclick="search()" id="search">查询</button>
            </div>
        </div>

    </div>
    <table class="layui-hide" id="jakq_table" lay-filter="jakq_table"></table>
</div>
</body>
<script src="/layui/layui.all.js"></script>
<script src="/js/core.util.js"></script>
<script>
    //获取token
    var token = CoreUtil.getData("access_token");
    //地址栏转义token中的#号
    var tokenQuery = token.replace("#", "%23");
    var tableIns1;
    var table = layui.table;
    var form = layui.form;
    var layer = layui.layer;
    var $ = jQuery = layui.jquery;
    var laydate = layui.laydate;
    var tree = layui.tree;
    var startTime = null;
    var endTime = null;
    layui.config({
        base: '/'
    }).extend({
        eleTree: 'layui-ext/eleTree/eleTree'
    }).use(['table', 'laypage', 'layer', 'laydate', 'tree', 'eleTree'], function () {
        var whereParams = {
            "username":"0CF9F5103FA0429B8C0224AF56A1D63B",
            "password":"0CF9F5103FA0429B8C0224AF56A1D63B",
            "serviceId":"0013",
            "param": {
                "attentionCaseDetailParams":{
                    "swjgDm":'00',
                    "caseType":"1",
                    "ajzt":$("#ajzt").val()
                }
            }
        };
        tableIns1 = table.render({
            elem: '#jakq_table'
            , contentType: 'application/json'
            , headers: {"authorization": token}
            ,where :whereParams
            ,page:true
            , limits:[10]
            , url: '/attention/jaqkdetail' //数据接口
            , method: 'POST'
            , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data) ? null : res.data.records //解析数据列表
                }
            }
            , cols: [
                [
                    // {type: 'checkbox', fixed: 'left'},
                    {field: 'jcajbh', title: '案件编号', width: 200},
                    {field: 'nsrmc', title: '纳税人名称', width: 200},
                    {field: 'nsrsbh', title: '纳税人识别号', width: 200},
                    {field: 'larq', title: '立案日期', width: 200},
                    {field: 'jcksmc', title: '所在科室', width: 100},
                    {field: 'jsajzt', title: '金三案件状态', width: 100},
                    {field: 'jczsajzt', title: '助手案件状态', width: 200},
                    {field: 'jcr', title: '检查人员', width: 200},
                    {field: 'slry', title: '审理人员', width: 200},
                    {field: 'zxry', title: '执行人员', width: 200}
                ]
            ]
            , toolbar: '#toolbar'
        });

        //初始化检查科室查询条件
        CoreUtil.sendPost("/attention/gy/getcurrentswjgjcks", null, function(res) {
            let datas = res.data;
            let options = "<option value = '00'>请选择检查科室</option><option value = '00'>全局</option>";
            for (let i = 0; i < datas.length; i++) {
                options += '<option value="' + datas[i].swjgDm + '">' + datas[i].swjgjc + '</option>';
            }
            $('#checkKeShi').append(options);
            // 更新select渲染
            form.render('select');
        });
    });

    //执行查询
    function search() {
        //这里以搜索为例
        var whereParams = {
            "username":"0CF9F5103FA0429B8C0224AF56A1D63B",
            "password":"0CF9F5103FA0429B8C0224AF56A1D63B",
            "serviceId":"0013",
            "param": {
                "attentionCaseDetailParams":{
                    "swjgDm":$("#checkKeShi").val(),
                    "caseType":"1",
                    "ajzt":$("#ajzt").val()
                }
            }
        };
        tableIns1.reload({
            where: whereParams
            , page: {
                curr: 1 //重新从第 1 页开始
            }
        });
    }
</script>
</html>